#include<iostream>
#include<algorithm>

using namespace std;
const int N=1e5+10;
char s[N]; 
char a[7]={"AEIOUY"};

int main()
{
	gets(s);
	int x=0; 
	while(s[x]!='?') x++;
	
	while(!(s[x]>='a'&&s[x]<='z'||s[x]>='A'&&s[x]<='Z')) x--;
	
	for(int i=0;i<6;i++){
		if(s[x]==a[i]||s[x]==a[i]+32){
			printf("YES");
			return 0;
		}
	} 
	printf("NO");
	return 0;
}
